package com.sdlh.demo.springboot.common.mqtt;

import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;

public class MqttApplicationContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
    @Override
    public void initialize(ConfigurableApplicationContext applicationContext) {
        MQTTConnect mqttConnect = new MQTTConnect();
        try {
            mqttConnect.onStart();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
